/* This file was generated with JastAdd2 (http://jastadd.org) version R20121112 (r872) */
package icode;

import util.*;
import java.util.*;
/**
 * @production Call : {@link Instruction} ::= <span class="component">&lt;Label:String&gt;</span> <span class="component">&lt;Levels:int&gt;</span>;
 * @ast node
 * @declaredat /Users/yonk/Documents/workspace/YCompiler/icodespec/icode.ast:4
 */
public class Call extends Instruction implements Cloneable {
  /**
   * @apilevel low-level
   */
  public void flushCache() {
    super.flushCache();
  }
  /**
   * @apilevel internal
   */
  public void flushCollectionCache() {
    super.flushCollectionCache();
  }
  /**
   * @apilevel internal
   */
  @SuppressWarnings({"unchecked", "cast"})
  public Call clone() throws CloneNotSupportedException {
    Call node = (Call)super.clone();
    return node;
  }
  /**
   * @apilevel internal
   */
  @SuppressWarnings({"unchecked", "cast"})
  public Call copy() {
      try {
        Call node = (Call)clone();
        if(children != null) node.children = (ASTNode[])children.clone();
        return node;
      } catch (CloneNotSupportedException e) {
      }
      System.err.println("Error: Could not clone node of type " + getClass().getName() + "!");
      return null;
  }
  /**
   * Create a deep copy of the AST subtree at this node.
   * The copy is dangling, i.e. has no parent.
   * @return dangling copy of the subtree at this node
   * @apilevel low-level
   */
  @SuppressWarnings({"unchecked", "cast"})
  public Call fullCopy() {
    try {
      Call tree = (Call) clone();
      tree.setParent(null);// make dangling
      if (children != null) {
        tree.children = new ASTNode[children.length];
        for (int i = 0; i < children.length; ++i) {
          if (children[i] == null) {
            tree.children[i] = null;
          } else {
            tree.children[i] = ((ASTNode) children[i]).fullCopy();
            ((ASTNode) tree.children[i]).setParent(tree);
          }
        }
      }
      return tree;
    } catch (CloneNotSupportedException e) {
      throw new Error("Error: clone not supported for " +
        getClass().getName());
    }
  }
  /**
   * @ast method 
   * @aspect icodeToString
   * @declaredat /Users/yonk/Documents/workspace/YCompiler/icodespec/icodeToString.jadd:42
   */
  public void appendBody(TabbedBuffer buffer) {
        buffer.append("CALL");
        buffer.append(getLabel());
        buffer.append("levels(" + getLevels() + ")");
    }
  /**
   * @ast method 
   * 
   */
  public Call() {
    super();


  }
  /**
   * @ast method 
   * 
   */
  public Call(String p0, int p1) {
    setLabel(p0);
    setLevels(p1);
  }
  /**
   * @apilevel low-level
   * @ast method 
   * 
   */
  protected int numChildren() {
    return 0;
  }
  /**
   * Replaces the lexeme Label.
   * @param value The new value for the lexeme Label.
   * @apilevel high-level
   * @ast method 
   * 
   */
  public void setLabel(String value) {
    tokenString_Label = value;
  }
  /**
   * @apilevel internal
   * @ast method 
   * 
   */
  
  /**
   * @apilevel internal
   */
  protected String tokenString_Label;
  /**
   * Retrieves the value for the lexeme Label.
   * @return The value for the lexeme Label.
   * @apilevel high-level
   * @ast method 
   * 
   */
  public String getLabel() {
    return tokenString_Label != null ? tokenString_Label : "";
  }
  /**
   * Replaces the lexeme Levels.
   * @param value The new value for the lexeme Levels.
   * @apilevel high-level
   * @ast method 
   * 
   */
  public void setLevels(int value) {
    tokenint_Levels = value;
  }
  /**
   * @apilevel internal
   * @ast method 
   * 
   */
  
  /**
   * @apilevel internal
   */
  protected int tokenint_Levels;
  /**
   * Retrieves the value for the lexeme Levels.
   * @return The value for the lexeme Levels.
   * @apilevel high-level
   * @ast method 
   * 
   */
  public int getLevels() {
    return tokenint_Levels;
  }
}
